//
//  WebViewViewController.swift
//  xdjcy
//
//  Created by Henry on 15/12/8.
//  Copyright (c) 2015年 Henry. All rights reserved.
//

import UIKit

class WebViewViewController: UIViewController,UIWebViewDelegate,UIGestureRecognizerDelegate{

    @IBOutlet var webview: UIWebView!
    var progress:MBProgressHUD!
    var showUrl = ""
    var tabName = ""
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.navigationController?.interactivePopGestureRecognizer.delegate = self
        
        self.navigationController?.navigationBar.tintColor =  UIColor.whiteColor()
        var backButton = UIBarButtonItem(image: UIImage(named: "back"), style: UIBarButtonItemStyle.Bordered, target: self, action: "goBack")
        self.navigationItem.leftBarButtonItem = backButton
        
        self.title = tabName
        self.progress = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
        webview.delegate = self
        var url = NSURL(string: showUrl)
        var urlRequest = NSURLRequest(URL: url!)
        webview.loadRequest(urlRequest)
    }
    
    func goBack()
    {
        self.navigationController?.popViewControllerAnimated(true)
    }
    
    func webViewDidFinishLoad(webView: UIWebView) {
        self.progress.hide(true)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
